package com.zrrd.propertiesAndIo;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;
import java.util.Set;

/**
 * @author WanJl
 * @version 1.0
 * @title ProertiesDemo02
 * @description
 * @create 2024/5/26
 */
public class PropertiesDemo02 {
    public static void main(String[] args) throws IOException {
        //创建集合对象
        Properties prop = new Properties();
        prop.setProperty("name", "张三");
        prop.setProperty("username", "zhangsan");
        prop.setProperty("password", "123456");

        FileWriter fw = new FileWriter("./users.properties");

        prop.store(fw,"这是用户的信息包括用户名、姓名、密码");

        fw.close();
    }
}
